//
//  JFBaseWebViewController.h
//  JFBase
//
//  Created by Alan Wang on 2018/8/22.
//  Copyright © 2018年 Alan Wang. All rights reserved.
//

#import <JFBase/JFBase.h>
#import <WebKit/WebKit.h>

typedef void (^AWCallJSResponseCallback)(id responseData);

typedef NS_ENUM(NSInteger, AWWEBVIEW_TYPE) {
     AWWEBVIEW_TYPE_WKWEBVIEW = 0
};

typedef NS_OPTIONS(NSUInteger, JFWebLeftItemStyle) {
    JFWebLeftItemStyleNone               = 1,    //不需要任何按钮
    JFWebLeftItemStyleBack              = 1 << 1,
    JFWebLeftItemStyleClose              = 1 << 2
};


@interface AWWebViewConfiguration : NSObject
//进度条颜色
@property(nonatomic,strong) UIColor * progressColor;
//背景色
@property(nonatomic,strong) UIColor * backgroundColor;
//webView的背景色
@property(nonatomic,strong) UIColor * webViewBackgroundColor;

//进度条背景色
@property(nonatomic,strong) UIColor * progressBackgroundColor;

@property(nonatomic,strong) UIColor * progressTintColor;

//是否开启和js交互的桥
@property(nonatomic,assign) BOOL  endableJavascriptBridge;
@end



@interface JFBaseWebViewController : JFBaseViewController


@property(nonatomic,strong) WKWebView * wkWebView;

//需要加载的webView;
@property(nonatomic,assign) AWWEBVIEW_TYPE type;
@property(nonatomic,assign) JFWebLeftItemStyle backStyle;
//url字符串 不支持本地文件
@property(nonatomic,copy) NSString * urlStr;

//导航栏标题
@property(nonatomic,copy) NSString * webtitle;
//底部需要空出来的区域
@property(nonatomic,assign) CGFloat  bottomOffset;
//是否隐藏导航栏
@property(nonatomic,assign) BOOL  hideNav;

@property(nonatomic,strong) AWWebViewConfiguration * config;

//调用js的方法
-(void)callJS:(NSString*)method  data:(id)data  responseCallback:(AWCallJSResponseCallback)block;

//加载本地的html
- (void)loadHTMLString:(NSString *)string baseURL:(nullable NSURL *)baseURL;

-(void)reloadUrl;

@end
